Endpoint Upsert [Dynamic Endpoint] (Update or Insert)
Name
upsert_[dynamic_endpoint_name]
Description
Related Tables
Parameters
| Parameter | Required | Options | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
Name:
Label: Triggers |
||||||||||
|
Name:
Label: Duplicate_Check_Fields |
|
Output Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| id |
DT_WSTR
|
nvarchar(255)
|
255 | |
| code |
DT_WSTR
|
nvarchar(255)
|
255 | |
| message |
DT_WSTR
|
nvarchar(1000)
|
1000 | |
| status |
DT_WSTR
|
nvarchar(255)
|
255 | |
| duplicate_field |
DT_WSTR
|
nvarchar(255)
|
255 | |
| expected_data_type |
DT_WSTR
|
nvarchar(255)
|
255 | |
| api_name |
DT_WSTR
|
nvarchar(255)
|
255 | |
| modified_time |
DT_DBTIMESTAMP
|
datetime
|
||
| modified_by_name |
DT_WSTR
|
nvarchar(255)
|
255 | |
| modified_by_id |
DT_WSTR
|
nvarchar(255)
|
255 | |
| created_time |
DT_DBTIMESTAMP
|
datetime
|
||
| created_by_name |
DT_WSTR
|
nvarchar(255)
|
255 | |
| created_by_id |
DT_WSTR
|
nvarchar(255)
|
255 |
Input Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| -Dynamic- |
DT_WSTR
|
nvarchar(4000)
|
4000 |
Examples
SSIS
Use Zoho CRM Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Destination
This Endpoint belongs to the [Dynamic Table] table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to upsert [dynamic endpoint]:
| Optional Parameters | |
|---|---|
| Triggers | "approval","workflow","blueprint" |
| Duplicate_Check_Fields | |
ODBC application
Use these SQL queries in your ODBC application data source:
Upsert an account
<p>Updates or inserts an Account record. This example demonstrates using the <code>UPSERT INTO</code> statement, which checks for existing records based on unique fields before deciding to update or insert.</p>
UPSERT INTO Accounts(Account_Name, Phone) VALUES('Company ABC','111-567-8888') WITH(Output=1)
Upsert a lead
<p>Updates or inserts a Lead record. This example demonstrates using the <code>UPSERT INTO</code> statement for Leads, updating based on unique fields like Email.</p>
UPSERT INTO Leads(Last_Name, Email) VALUES('Patel','zpatel@abc.com') WITH(Output=1)
Bulk upsert accounts using SQL Server data
<p>Upserts multiple Account records in bulk using data from a SQL Server database. This example demonstrates using the <code>SOURCE</code> clause with <code>UPSERT INTO</code> to synchronize data from an external source to Zoho CRM.</p>
UPSERT INTO Accounts
SOURCE(
'MSSQL' --ODBC or OLEDB
,'Data Source=localhost;Initial Catalog=Test;Integrated Security=true'
,'select ''Test Account-A'' as Account_Name,''111-111-1111'' as Phone
UNION
select ''Test Account-B'' as Account_Name,''222-222-2222'' as Phone
'
)
upsert_[dynamic_endpoint_name] endpoint belongs to
[Dynamic Table]
table(s), and can therefore be used via those table(s).
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Upsert an account
<p>Updates or inserts an Account record. This example demonstrates using the <code>UPSERT INTO</code> statement, which checks for existing records based on unique fields before deciding to update or insert.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPSERT INTO Accounts(Account_Name, Phone) VALUES(''Company ABC'',''111-567-8888'') WITH(Output=1)';
EXEC (@MyQuery) AT [LS_TO_ZOHO_CRM_IN_GATEWAY];
Upsert a lead
<p>Updates or inserts a Lead record. This example demonstrates using the <code>UPSERT INTO</code> statement for Leads, updating based on unique fields like Email.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPSERT INTO Leads(Last_Name, Email) VALUES(''Patel'',''zpatel@abc.com'') WITH(Output=1)';
EXEC (@MyQuery) AT [LS_TO_ZOHO_CRM_IN_GATEWAY];
Bulk upsert accounts using SQL Server data
<p>Upserts multiple Account records in bulk using data from a SQL Server database. This example demonstrates using the <code>SOURCE</code> clause with <code>UPSERT INTO</code> to synchronize data from an external source to Zoho CRM.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPSERT INTO Accounts
SOURCE(
''MSSQL'' --ODBC or OLEDB
,''Data Source=localhost;Initial Catalog=Test;Integrated Security=true''
,''select ''''Test Account-A'''' as Account_Name,''''111-111-1111'''' as Phone
UNION
select ''''Test Account-B'''' as Account_Name,''''222-222-2222'''' as Phone
''
)';
EXEC (@MyQuery) AT [LS_TO_ZOHO_CRM_IN_GATEWAY];
upsert_[dynamic_endpoint_name] endpoint belongs to
[Dynamic Table]
table(s), and can therefore be used via those table(s).